<template>
    <div class="twob">
        <div class="imgBox" v-if="arr.length!=0"><img :src="arr[0].backgroundImage5[2]" alt=""></div>
        <div class="wrap">
             <Pz v-for="(v,i) in arrb" 
            :key="i" 
            :cakeimage="v.cakeimage" 
            :cakename="v.cakename" 
            :cakeprice="v.cakeprice" 
            :cakeoriginal="v.cakeoriginal" 
            :goodsid="v.goodsid" 
            :cakeingredients="v.cakeingredients"
            />
        </div>
    </div>
</template>

<script>
import {getlink} from "@/api/getapi.js"
import Pz from "@/components/ddgHD/popularzi.vue"
export default {
    data(){
        return {
            arr:[],
            arrb:[]
        }
    },
    mounted(){
        getlink("/data/ddg").then((ok)=>{
            this.arr=ok.data.slider
        })
    },
    created(){
        getlink("http://180.76.121.47:8008/cake").then((ok)=>{
            ok.data.data.forEach((el)=>{
                if(el.typeid==1021){
                    this.arrb.push(el)
                }
            })
        })
    },
    components:{
        Pz
    }
}
</script>

<style scoped>
    .twob{
        font-size: 0.12rem;
    }
    .imgBox{
        width: 100%;
    }
    img{
        margin-top: 0.2rem;
        width: 100%;
    }
    .wrap{
        display: flex;
        justify-content: space-evenly;
        flex-wrap: wrap;
    }
</style>